cmake_minimum_required(VERSION 3.10)
project(cppv2_sample)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")

set(TARGET cppv2_sample)
add_compile_options(-std=c++11 -fPIE -fstack-protector-all -fPIC -Wl,-z,relro,-z,now,-z,noexecstack -s -pie -Wall)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0 -Dgoogle=mindxsdk_private)

set(MX_SDK_HOME /home/duzhenlong2/MindX_SDK_HOME/mxVision-3.0.RC3)

include_directories(
        ${MX_SDK_HOME}/include
        ${MX_SDK_HOME}/opensource/include
        ${MX_SDK_HOME}/opensource/include/opencv4
        ${MX_SDK_HOME}/opensource/include/opencv4/opencv2
        ${MX_SDK_HOME}/include/MxBase
        ${MX_SDK_HOME}/include/MxBase/PluginToolkit
        ${MX_SDK_HOME}/include/MxBase/PluginToolkit/base  
        /usr/local/Ascend/ascend-toolkit/latest/include
        /usr/local/Ascend/ascend-toolkit/latest/runtime/include       
        ./lib
)

link_directories(
        ${MX_SDK_HOME}/lib
        ${MX_SDK_HOME}/lib/modelpostprocessors
        ${MX_SDK_HOME}/opensource/lib/
        ${MX_SDK_HOME}/opensource/lib64
        /usr/local/Ascend/ascend-toolkit/latest/acllib/lib64
        /usr/local/Ascend/driver/lib64/
        /home/duzhenlong2/MindX_SDK_HOME/mxVision-3.0.RC3/opensource/lib
        ./lib
)

add_executable(cppv2_sample ./src/mainV2.cpp ./src/cppv2.cpp)
target_link_libraries(cppv2_sample     
        avformat
        avcodec
        avdevice
        avutil
        swresample        
        glog
	acl_dvpp
	ascendcl
        mxbase
        
        -lpthread
        -lm
	acl_dvpp_mpi
        cpprest
        opencv_world
        mindxsdk_protobuf
        mxpiopenposeproto
        yolov3postprocess #! if use sdk yolov3 postprocess must ADD this lib
        )
